import java.util.Scanner;

public class FCTRLHandMultiply {
	public static void main(String args[]) {

		Scanner in = new Scanner(System.in);

		// Enter number of testcase
		int testcases = in.nextInt();

		while (testcases != 0) {
			int numZeros = 0;
			int number = in.nextInt();

			while (number > 0) {
				number /= 5;
				numZeros += number;
			}
			System.out.println(numZeros);
			testcases--;
		}
	}
}
